<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function downCount (end) {
            var start = new Date()

            var ms = +end - +start
            var s = ms / 1000
            
            var dd = parseInt(s / 60 / 60 /24)
            var hh = Math.floor(s / 60 / 60 %24)
            var mm = Math.floor(s / 60 % 60)
            var ss = Math.floor(s % 60)
            
            return {
                tian : dd,
                xiaoshi : hh,
                fen : mm,
                miao : ss
            }
        }
        var result = downCount(new Date('2020-11-11'))
        document.write('距离双十一还剩' + result.tian + '天' + result.xiaoshi + '小时' + result.fen + '分钟' +result.miao +'秒')
    </script>
</body>
</html>